<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>邀约列表</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <!--<a class="btn" href="{:U('add')}">新增便民信息</a>-->
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="keyword" class="search-input" value="{:I('keyword')}" placeholder="请输入需求关键字">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('invitelist')}"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table class="">
            <thead>
            <tr>
                <th>编号</th>
                <th>需求</th>
                <th>需求人数</th>
                <th>有效期限</th>
                <th>愿付酬金</th>
                <th>邀约地点</th>
                <th>应邀申请人数</th>
                <th>是否支付手续费</th>
                <th>发布时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.demand}</td>
                    <td>{$vo.number}</td>
                    <td>{$vo.eff_time}</td>
                    <td>{$vo.money}</td>
                    <td>{$vo.place}</td>
                    <td>{$vo.ying_num}</td>
                    <td>{$vo.pay}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['up_time'])}</td>
                    <td>
                        <a href="{:U('details?id='.$vo['id'])}">详情</a>
                        <a href="{:U('delete?id='.$vo['id'])}" class="confirm ajax-get">删除</a>
                    </td>
                </tr>
            </volist> <else />
                <td colspan="10" class="text-center">aOh! 暂时还没有内容!</td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">{$_page}</div>
</block>

<block name="script">
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav('{:U('Invite/invitelist')}');
    </script>
</block>
